-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add resource type #189
Conversation
✅ Deploy Preview for tauri-bindgen canceled.
|
7a2ee4b
to
2b8bef5
Compare
Requested a review from @tauri-apps/wg-webview bc you are probably the most appropriate for this field, not really sure though |
I think @tauri-apps/wg-tauri is better suited for this, however I have not been following the tauri-bindgen closely so I am not sure what I should be looking at to review. I should not that I needed to have a resource table in tauri-apps/tauri#7709 so I used deno's implementation (but with
How would this struct look like if I have multiple resources? would it look like this? struct Ctx {
a: ResourceTable,
b: ResourceTable,
c: ResourceTable,
} If so, it seems unnecessary, if applying to the menu PR I linked above, where I usually need to use 2~4 different menu types (aka resources), I will have to lock 2~4, instead of just one lock with a central resource table. |
Yeah so I slapped this ResourceTable impl together just to have something that works. But you're not forced to use it at all, the idea is that the generated trait forces you to implement a method called It doesn't really matter what structure you use to store the resources as long as you can produce a reference to it when asked. |
This finally fixes the implementation of the resource type.
Details
Take the following wit file:
It translates into this host code:
TODO list